<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="/css/common.css" />
		<link rel="stylesheet" type="text/css" href="/bootstrap-3.3.7/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/css/flatpickr.min.css" />
		<link rel="stylesheet" type="text/css" href="/css/font-awesome.css"/>
		<link rel="stylesheet" type="text/css" href="/dialog/css/dialog.css"/>
		<link rel="stylesheet" href="/css/shoufengqin.css">
		<link rel="stylesheet" type="text/css" href="/css/haha.css" media="screen" />


		<script src="/js/jquery-1.9.1.min.js" type="text/javascript" ></script>
		<script src="/js/google-maps.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/dialog/js/dialog.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/jquery.form.js"></script>
		<script src="/js/common.js"></script>
		<script src="/js/flatpickr.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/shoufengqin.js"></script>
		<script src="/laydate/laydate.js"></script> <!-- 改成你的路径 -->
        <script type="text/javascript">
            $().ready(function(){
                $("#addform").validate({
                    rules:{
                        compname:"required",
                    },
                    message:{
                        compname:"此项必填",
                    }
                });
                // if(document.getElementsByName(compcode)[0].values()==null){
                 //    alert("请选择公司类型");
                 //    return false;
				// }
            });
        </script>

	</head>

	<body>
		<!--顶部导航 -->
        <nav class="topNavItemBox">
            <div id="ItemBox">
                <div class="title">智慧溯源系统</div>
                <div class="subtitle">肉品溯源管理</div>
                <div class="rightUserInfo">
                    <div class="commentAvatarDiv">
                        <img class="commentAvatarImage" src="/images/people.jpg">
                    </div>
                    <div class="userName">
					<#if Session.curEmployeeInfo??>
                        <a href="/admin/logout">${Session.curEmployeeInfo.emName}</a>
					</#if>
                    </div>
                    <span class="glyphicon glyphicon-option-vertical userIcon" aria-hidden="true"></span>
                </div>
            </div>
        </nav>
		<div class="contain">
			<#include "leftPage.ftl">
		</div>
			<!-- 新增疫苗入库信息 -->
			<div id="middle1" class="page_main">
				<div id="middle2" class="page_content">
				<div class="add_title">
					<div class="second_title_main">供应商管理</div>
					<div class="second_title_main_bread">   > </div>
                    <div class="second_title_main">修改供应商信息</div>
				</div>
					<form id="addform" action="update" method="post">
						<input name="gid" value="${companyInfo.gid}" type="text" hidden="true">
						<ul>
							<li><label class="labelBeforinput">公司名称</label><input name="compname"  value="${companyInfo.compname}" class="bigInputtext" required type="text">*</li>
							<li><label class="labelBeforinput">公司类型</label><select name="comptypeid" class="bigInputtext">
								<option value="101" <#if companyInfo.comptypeid = 101>selected</#if>>疫苗供应商</option>
								<option value="102" <#if companyInfo.comptypeid = 102>selected</#if>>饲料供应商</option>
                                <#--<option value <#if companyInfo.comptypeid != 101 && companyInfo.comptypeid != 102>selected</#if>>请选择供应商类型</option>-->
							</select>*</li>
							<li><label class="labelBeforinput">企业等级</label><input name="companylevel"  value="${companyInfo.companylevel}" class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">注册地址</label><input name="regaddr"  value="${companyInfo.regaddr}" class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">注册资金</label><input name="capital"  value="${companyInfo.capital}" class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">组织机构代码</label><input name="compcode" value="${companyInfo.compcode}"  class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">联系人</label><input name="contacts" value="${companyInfo.contacts}"  class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">联系人电话</label><input name="contactsphone" value="${companyInfo.contactsphone}"  class="bigInputtext" type="text" required></li>
							<li><label class="labelBeforinput">法人</label><input name="legalpname"  value="${companyInfo.legalpname}" class="bigInputtext" type="text"></li>
							<li><label class="labelBeforinput">法人身份证号</label><input name="legalcode" value="${companyInfo.legalcode}"  class="bigInputtext" type="text"></li>
							<li><label class="labelBeforinput">投诉电话</label><input name="complaintphone" value="${companyInfo.complaintphone}"  class="bigInputtext" type="text"></li>
							<li><input type="submit" value="确认" style="margin-left:50px;width: 100px;background-color: #00BFFF;" /></li>
						</ul>
					</form>
				
				</div>
			</div>
		</div>
		<div class="footer">
				<div class="footer_lineone">
					<span id="logo"></span>肉品溯源管理系统 
					<span class="footer_lineoneSpan"><a href="aboutus.html">关于我们</a></span>
					<span class="footer_lineoneSpan"><a target="_blank" href="http://www.cfsiw.com/">食品安全信息</a></span> 
					<span class="footer_lineoneSpan"><a href="suggestionAdd.ftl">联系我们</a></span>
				</div>
				<div class="footer_linetwo">
					 &copy;2017广东技术师范学院
				</div>
			</div>
	</body>
	<script type="text/javascript" charset="UTF-8">
		$(function() {
            //表单提交
            $("#addform").ajaxForm({
                success:function(data) {
                    var str = null;
                    var msg = null;
                    if(data.code == 0){
                        str = "success";
                        msg = "更新成功";
                        $.dialog({
                            type: 'info',
                            contentHtml: '<img class="info-icon" src="/dialog/images/icon/'+str+'.png" /><p class="info-text">'+msg+'</p>',
                            autoClose: 500
                        });
                        setTimeout('window.location.href="list"',1000);
                    }else{
                        str = "fail";
                        msg = "更新失败";
                        $.dialog({
                            type: 'info',
                            contentHtml: '<img class="info-icon" src="/dialog/images/icon/'+str+'.png" /><p class="info-text">'+msg+'</p>',
                            autoClose: 1000
                        });
                        setTimeout('window.location.href="list"',1000);
                    }

                }
            });

            //初始化侧边栏
            $(".vertical-nav").verticalnav({
                speed: 400,
                align: "left"
            });

            //时间选择组件
            laydate.render({
                elem: '#test1' //指定元素
            });
            laydate.render({
                elem: '#test2' //指定元素
            });
            laydate.render({
                elem: '#test3' //指定元素
            });

            jQuery(document).ready(function ($) {
                $('.list22 ul li p').clickdown();
                $('.list-se p[class=title22]').clickup();
                $('.list22>ul>li').ad();
            });
        });
	</script>
</html>